from django.test import TestCase

from ..forms import AddTaskForm


class AddTaskFormTest(TestCase):

    def test_add_task_form_title_field_label(self):
        form = AddTaskForm()
        self.assertTrue(form.fields['title'].label is None or form.fields['title'].label == 'Название')

    def test_add_task_form_description_widget_attrs(self):
        form = AddTaskForm()
        self.assertEqual(form.fields['description'].widget.attrs, {'rows':4, 'cols':20})

    def test_add_task_form_title_max_length(self):
        form = AddTaskForm()
        self.assertEqual(form.fields['title'].max_length, 100)
    